import request from '@/utils/request'

// 获取合作商点位汇总
export const getNodeCollect = () => {
  return request.get('/vm-service/node/nodeCollect')
}

// 获取点位总数
export const getNodeCount = () => {
  return request.get('/vm-service/node/count')
}

// 获取售货机货道详情
export const getChannelList = innerCode => request.get(`/vm-service/channel/channelList/${innerCode}`)

// 获取区域列表
export const getEreaList = params => request.get('/vm-service/region/search', { params })

// 新增区域
export const addErea = data => request.post('/vm-service/region', data)

// 修改区域
export const modifyErea = data => request.put(`/vm-service/region/${data.id}`, data)

// 删除区域
export const delErea = id => request.delete(`/vm-service/region/${id}`)

// 获取区域详情
export const getEreaDetail = params => request.get('/vm-service/node/search', { params })

// 获取商圈列表
export const getBusinessType = () => request.get('/vm-service/businessType')

// 新增点位
export const addNode = data => request.post('/vm-service/node', data)

// 修改点位
export const modifyNode = data => request.put(`/vm-service/node/${data.id}`, data)

// 获取点位详情
export const getNodeDetail = id => request.get(`/vm-service/node/vmList/${id}`)

// 删除点位
export const delNode = id => request.delete(`/vm-service/node/${id}`)

// 搜索售货机(售货机列表)
export const getEquipList = params => request.get('/vm-service/vm/search', { params })

// 获取售货机的维修次数
export const getRepairCount = data => request.get(`/task-service/task/repairCount/${data.innerCode}/${data.start}/${data.end}`, data)

// 获取售货机补货次数
export const getSupplyCount = data => request.get(`/task-service/task/supplyCount/${data.innerCode}/${data.start}/${data.end}`, data)

// 获取售货机商品销量
export const getSkuCollect = data => request.get(`/order-service/report/skuCollect/${data.innerCode}/${data.start}/${data.end}`, data)

// 获取销售量总数
export const getOrderCount = params => request.get('/order-service/report/orderCount', { params })

// 获取销售额总数
export const getOrderAmount = params => request.get('/order-service/report/orderAmount', { params })

// 订单搜索
export const getOrderList = params => request.get('/order-service/order/search', { params })
